import request from '@/utils/request'

// 获得销售列表
export function getAgent(params) {
  return request({
    url: '/merchant/api/v1/agent',
    method: 'get',
    params
  })
}

// 详情

export function getAgentQuery(uid) {
  return request({
    url: `/merchant/api/v1/agent/query/${uid}`,
    method: 'get'
  })
}

// 搜索手机号
export function getAgentUser(params) {
  return request({
    url: '/merchant/api/v1/agent/user',
    method: 'get',
    params
  })
}
// 设置利润
export function setAgentProfit(data) {
  return request({
    url: '/merchant/api/v1/agent/profit',
    method: 'post',
    data
  })
}
// 绑定销售
export function setAgentBind(data) {
  return request({
    url: '/merchant/api/v1/agent/bind',
    method: 'post',
    data
  })
}
// 解除绑定
export function deleteAgent(uid) {
  return request({
    url: `/merchant/api/v1/agent/remove/${uid}`,
    method: 'delete'
  })
}
